#include <iostream>
#include <unistd.h>
#include <signal.h>

void myhandler(int signo)
{
    std::cout << "process get a signal: " << signo << std::endl;
    exit(1);
}

int main()
{
    for (int i = 1; i <= 31; ++i)
    {
        signal(i, myhandler);
    }
    while (true)
    {
        std::cout << "This is a process. pid: " << getpid() << std::endl;
        sleep(1);
    }
    return 0;
}